#include "calc.h"
#include <ctime>

void calc::outHis() {
	try {
		history += sourceStr + "\n                                  =" + convstr + "\n";
	} catch (...) {
		throw;
	}
}


void calc::outLog(string msg) {
	try {
		time_t t = time(0);
		char tmp[64];
#ifdef _MSC_VER
		tm timeTm;
		localtime_s(&timeTm,&t);
		strftime(tmp, sizeof(tmp), "%Y/%m/%d %H:%M:%S",&timeTm );
#else
		strftime(tmp, sizeof(tmp), "%Y/%m/%d %H:%M:%S", localtime(&t));
#endif
		eventLog += string(tmp)+" -> "+msg + "\n";
	} catch (...) {
		throw;
	}
}